package p270jp.pxv.android.setting.presentation.activity;

import android.content.SharedPreferences;
import java.util.Objects;
import kotlin.NoWhenBranchMatchedException;
import p189gn.AbstractC3446l;
import p216hn.Lambda;
import p270jp.pxv.android.commonObjects.model.AppTheme;
import p270jp.pxv.android.setting.presentation.flux.AppThemeSettingActionCreator;
import p325m0.MutabilityOwnership;
import p395oh.AppThemeService;
import p450ql.AppThemeSettingAction;
import p603wm.Unit;

/* compiled from: AppThemeSettingActivity.kt */
/* renamed from: jp.pxv.android.setting.presentation.activity.b */
/* loaded from: classes2.dex */
public final class C4322b extends Lambda implements AbstractC3446l<AppTheme, Unit> {

    /* renamed from: a */
    public final /* synthetic */ AppThemeSettingActivity f19320a;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C4322b(AppThemeSettingActivity appThemeSettingActivity) {
        super(1);
        this.f19320a = appThemeSettingActivity;
    }

    @Override // p189gn.AbstractC3446l
    public Unit invoke(AppTheme appTheme) {
        int i;
        AppTheme appTheme2 = appTheme;
        MutabilityOwnership.m3745m(appTheme2, "it");
        AppThemeSettingActionCreator appThemeSettingActionCreator = (AppThemeSettingActionCreator) this.f19320a.f19311v.getValue();
        Objects.requireNonNull(appThemeSettingActionCreator);
        AppThemeService aVar = appThemeSettingActionCreator.f19322c;
        Objects.requireNonNull(aVar);
        Objects.requireNonNull(aVar.f24276b);
        if (MutabilityOwnership.m3749h(appTheme2, AppTheme.BatterySaver.INSTANCE)) {
            i = 4;
        } else if (MutabilityOwnership.m3749h(appTheme2, AppTheme.Dark.INSTANCE)) {
            i = 3;
        } else if (MutabilityOwnership.m3749h(appTheme2, AppTheme.Light.INSTANCE)) {
            i = 2;
        } else if (MutabilityOwnership.m3749h(appTheme2, AppTheme.SystemDefault.INSTANCE)) {
            i = 1;
        } else {
            throw new NoWhenBranchMatchedException();
        }
        SharedPreferences.Editor edit = aVar.f24275a.f24721a.edit();
        MutabilityOwnership.m3746l(edit, "editor");
        edit.putInt("app_theme_setting", i);
        edit.apply();
        appThemeSettingActionCreator.f19324e.m6297e();
        appThemeSettingActionCreator.f19325f.mo2437b(new AppThemeSettingAction.C5847a(appTheme2));
        ((AppThemeSettingActionCreator) this.f19320a.f19311v.getValue()).m4557d();
        return Unit.f29503a;
    }
}
